package com.credit.mola.app.utils.http

import com.credit.mola.app.utils.config.Configs
import okhttp3.Interceptor
import okhttp3.Response

/**
 * Sikadwa
 * @Author wwdeng
 * @CreateTime: 2024/5/21 16:12
 * @Annotation：通用拦截器
 */
class CommonHeaderInterceptor: Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        val originalRequest = chain.request()
        val newRequest = originalRequest.newBuilder()
            .header("appid", Configs.AppName)
            .header("product", Configs.AppName)
            .build()
        return chain.proceed(newRequest)
    }
}